package com.app.miwawa.api.esm.entity.contract;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.framework.common.api.entity.CommonEntityUUID;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 基本信息表
 * <p>描述: 合同</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年1月23日 上午8:49:14
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_ESM_CONTRACT_INFO")
public class Contract extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = 8197924030940696217L;

	// 合同编号 (HT-2016010001)
	@Column(name = "code", length = 50, nullable = true)
	private String code;
	
	// 购买项目
	@Column(name = "item", length = 10, nullable = true)
	private String item;

	// 发票抬头
	@Column(name = "title", length = 100, nullable = true)
	private String title;

	// 是否开具发票
	@Column(name = "invoice", length = 5, nullable = true)
	private String invoice;
	
	// 联系方式
	@Column(name = "mobile", length = 50, nullable = true)
	private String mobile;
		
	// 宝宝ID
	@Column(name = "student", length = 50, nullable = true)
	private String student;
	
	// 家长ID
	@Column(name = "parents", length = 50, nullable = true)
	private String parents;
	
	// 顾问ID
	@Column(name = "user_id", length = 50, nullable = true)
	private String userid;
	
	// 顾问姓名
	@Column(name = "user_name", length = 50, nullable = true)
	private String username;

	// 开始时间（有效期）
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "from_date", nullable = true)
	private Date fromDate;
	
	// 结束时间（有效期）
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "over_date", nullable = true)
	private Date overDate;
	
	// 创建时间（签约时间）
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "create_date", nullable = true)
	private Date createDate;
	
	// 合同备注
	@Lob
	@Column(name = "remark", nullable = true)
	private String remark;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getItem() {
		return item;
	}

	public void setItem(String item) {
		this.item = item;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getInvoice() {
		return invoice;
	}

	public void setInvoice(String invoice) {
		this.invoice = invoice;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getStudent() {
		return student;
	}

	public void setStudent(String student) {
		this.student = student;
	}

	public String getParents() {
		return parents;
	}

	public void setParents(String parents) {
		this.parents = parents;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Date getFromDate() {
		return fromDate;
	}

	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}

	public Date getOverDate() {
		return overDate;
	}

	public void setOverDate(Date overDate) {
		this.overDate = overDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}
